﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Eassets.Data.Global;
using Eassets.Layered.Domain.Global;
using System.Collections.ObjectModel;

namespace Eassets.Service.Global
{
    public class TransactionTypeService
    {
        TransactionTypeData transactionTypedata = new TransactionTypeData();

        /// <summary>
        /// Inserts transactionType.
        /// </summary>
        /// <param name="transactionType"></param>
        public void AddTransactionType(TransactionType transactionType)
        {
            if (transactionType != null)
            {
                transactionTypedata.AddTransactionType(transactionType);
            }
        }

        /// <summary>
        /// Updates transactionType.
        /// </summary>
        /// <param name="transactionType"></param>
        public void ModifyTransactionType(TransactionType transactionType)
        {
            if (transactionType != null)
            {
                transactionTypedata.ModifyTransactionType(transactionType);
            }
        }

        /// <summary>
        /// Delete transactionType.
        /// </summary>
        /// <param name="transactionTypeId"></param>
        public void DeleteTransactionType(long transactionTypeId)
        {
            if (transactionTypeId != 0)
            {
                transactionTypedata.DeleteTransactionType(transactionTypeId);
            }
        }

        /// <summary>
        /// GetbyId transactionType.
        /// </summary>
        /// <param name="transactionTypeId"></param>
        /// <returns></returns>
        public TransactionType GetByIdTransactionType(long transactionTypeId)
        {
            return transactionTypedata.GetByIdTransactionType(transactionTypeId);
        }

        /// <summary>
        /// GetAll transactionType.
        /// </summary>
        /// <returns></returns>
        public Collection<TransactionType> GetAllTransactionType()
        {
            return transactionTypedata.GetAllTransactionType();
        }
    }
}
